﻿using LinqToLfsWorld.Interface;
using System;
using LinqToLfsWorld.Attributes;
using System.Xml.Serialization;
using System.Runtime.Serialization;

namespace LinqToLfsWorld
{
	/// <summary>
	/// Individual racer statistics from Lfs World.
	/// </summary>
	[Serializable]
	[DataContract]
	public class RacerStats : ILfsWorldEntity
	{
		/// <summary>
		/// Gets or sets the name of the racer.
		/// </summary>
		/// <value>The name of the racer.</value>
		[PubstatQueryable(true)]
		[DataMember]
		public string RacerName { get; set; }

		/// <summary>
		/// Gets or sets the distance.
		/// </summary>
		/// <value>The distance.</value>
		[DataMember]
		public int Distance { get; set; }

		/// <summary>
		/// Gets or sets the total fuel used.
		/// </summary>
		/// <value>The fuel.</value>
		[DataMember]
		public int Fuel { get; set; }

		/// <summary>
		/// Gets or sets the total laps.
		/// </summary>
		/// <value>The laps.</value>
		[DataMember]
		public int Laps { get; set; }

		/// <summary>
		/// Gets or sets number the hosts joined.
		/// </summary>
		/// <value>The hosts joined.</value>
		[DataMember]
		public int HostsJoined { get; set; }

		/// <summary>
		/// Gets or sets the number of wins.
		/// </summary>
		/// <value>The wins.</value>
		[DataMember]
		public int Wins { get; set; }

		/// <summary>
		/// Gets or sets the number of second places.
		/// </summary>
		/// <value>The seconds.</value>
		[DataMember]
		public int Seconds { get; set; }

		/// <summary>
		/// Gets or sets the number of third places.
		/// </summary>
		/// <value>The thirds.</value>
		[DataMember]
		public int Thirds { get; set; }

		/// <summary>
		/// Gets or sets the number of races finished.
		/// </summary>
		/// <value>The races finished.</value>
		[DataMember]
		public int RacesFinished { get; set; }

		/// <summary>
		/// Gets or sets the number of qualification sessions completed
		/// </summary>
		/// <value>The qualifications.</value>
		[DataMember]
		public int Qualifications { get; set; }

		/// <summary>
		/// Gets or sets the number of pole positions.
		/// </summary>
		/// <value>The pole positions.</value>
		[DataMember]
		public int PolePositions { get; set; }

		/// <summary>
		/// Gets or sets the number of drag races completed.
		/// </summary>
		/// <value>The drag races.</value>
		[DataMember]
		public int DragRaces { get; set; }

		/// <summary>
		/// Gets or sets the number of drag race wins.
		/// </summary>
		/// <value>The drag race wins.</value>
		[DataMember]
		public int DragRaceWins { get; set; }

		/// <summary>
		/// Gets or sets the racer's country.
		/// </summary>
		/// <value>The country.</value>
		[DataMember]
		public string Country { get; set; }

		/// <summary>
		/// Gets or sets the online status.
		/// </summary>
		/// <value>The online status.</value>
		[DataMember]
		public OnlineStatus OnlineStatus { get; set; }

		/// <summary>
		/// Gets or sets the last host that was joined, if available.
		/// </summary>
		/// <value>The last host.</value>
		[DataMember]
		public string LastHost { get; set; }

		/// <summary>
		/// Gets or sets the last online time, if available.
		/// </summary>
		/// <value>The last online time.</value>
		[DataMember]
		public DateTime LastOnlineTime { get; set; }

		/// <summary>
		/// Gets or sets the ident of the last track which was joined, if available.
		/// </summary>
		/// <value>The last track ident.</value>
		[DataMember]
		public string LastTrackIdent { get; set; }

		/// <summary>
		/// Gets or sets the full name of the last track to be joined, if available.
		/// </summary>
		/// <value>The last name of the track.</value>
		[XmlIgnore]
		public string LastTrackName { get; internal set; }

		/// <summary>
		/// Gets or sets the last car used on a host.
		/// </summary>
		/// <value>The last car.</value>
		[DataMember]
		public string LastCar { get; set; }

	}
}
